package com.ztjava.core.bean.remind;

import java.io.Serializable;
import java.sql.Timestamp;

import com.alibaba.fastjson.JSONObject;
import com.jfinal.plugin.redis.Cache;
import com.jfinal.plugin.redis.Redis;
import com.xiaoleilu.hutool.date.DateUtil;
import com.ztjava.core.Constant;
import com.ztjava.core.utiliy.StringUtil;

public class RemindMsgBean implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 6573514226359337613L;
	public String getModel() {
		return model;
	}
	public void setModel(String model) {
		this.model = model;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getIs_read() {
		return is_read;
	}
	public void setIs_read(String is_read) {
		this.is_read = is_read;
	}
	public Integer getObject_id() {
		return object_id;
	}
	public void setObject_id(Integer object_id) {
		this.object_id = object_id;
	}
	public Integer getSeconds() {
		return seconds;
	}
	public void setSeconds(Integer seconds) {
		this.seconds = seconds;
	}
	public Integer getFrom_user_id() {
		return from_user_id;
	}
	public void setFrom_user_id(Integer from_user_id) {
		this.from_user_id = from_user_id;
	}
	public Integer getTo_user_id() {
		return to_user_id;
	}
	public void setTo_user_id(Integer to_user_id) {
		this.to_user_id = to_user_id;
	}
	public Timestamp getCreate_time() {
		return create_time;
	}
	public void setCreate_time(Timestamp create_time) {
		this.create_time = create_time;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getFrom_user_id_headimg() {
		return from_user_id_headimg;
	}
	public void setFrom_user_id_headimg(String from_user_id_headimg) {
		this.from_user_id_headimg = from_user_id_headimg;
	}
	public String getCreate_time_change() {
		return create_time_change;
	}
	public void setCreate_time_change(String create_time_change) {
		this.create_time_change = create_time_change;
	}
	public String getPlugin() {
		return plugin;
	}
	public void setPlugin(String plugin) {
		this.plugin = plugin;
	}
	public String getComponent() {
		return component;
	}
	public void setComponent(String component) {
		this.component = component;
	}
	
	public RemindMsgBean(String plugin,String component,String model,Integer object_id,
			Integer from_user_id,Integer to_user_id,String title,String content,Integer seconds){
		this.plugin = plugin;
		this.from_user_id = from_user_id;
		Cache cache = Redis.use();
		if(cache.hexists(Constant.R_USER, from_user_id+"")){
			JSONObject json = cache.hget(Constant.R_USER, from_user_id+"");
			this.from_user_id_headimg =json.getString("headimg");
		}
		this.to_user_id = to_user_id;
		this.component = component;
		this.model = model;
		this.object_id = object_id;
		this.title = title;
		this.content = content;
		this.create_time = DateUtil.date().toTimestamp();
		this.seconds = seconds;
		this.id = DateUtil.format(this.create_time,"yyyyMMddHHmmss")
				+"_"+from_user_id+"_"+to_user_id+"_"+StringUtil.getRandomString(20);
	}
	private String id;
	private String plugin;
	private String component;
	private String model;
	private Integer object_id;
	private Integer from_user_id;
	private String from_user_id_headimg;
	private Integer to_user_id;
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	private String title;
	private String content;
	private Integer seconds;
	private String is_read = "F";
	private Timestamp create_time;
	private String create_time_change;
}
